package cn.ac.jaas.isc.vegetable.common.security.annotation;

import cn.ac.jaas.isc.vegetable.common.security.component.VegetableResourceServerAutoConfiguration;
import cn.ac.jaas.isc.vegetable.common.security.component.VegetableSecurityBeanDefinitionRegistrar;
import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

import java.lang.annotation.*;

/**
 * @author 张高昌
 * @date 2022/4/23 9:28
 * @description: 资源服务注解
 */
@Documented
@Inherited
@EnableResourceServer
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Import({ VegetableResourceServerAutoConfiguration.class, VegetableSecurityBeanDefinitionRegistrar.class })
public @interface EnableVegetableResourceServer {

    /**
     * 是否开启本地模式
     * @return true
     */
    boolean isLocal() default true;
}
